package lab02.test05;

public class Cube {
    //变量：立方体的长、宽和高
    double length;
    double weight;
    double height;
    //立方体的体积
    public void volume() {
        System.out.println("体积为：");
        System.out.println(length * weight * height);
    }
    public static void main(String[] args) {
        Cube cub=null;
        cub=new Cube();
        cub.length=2;
        cub.weight=2;
        cub.height=2;
        cub.volume();
    }
}
